package com.example.lab2;


import org.springframework.boot.CommandLineRunner;
import org.springframework.core.env.Environment;

import java.util.Objects;

@SuppressWarnings("unused")
class CustomCommandLineRunner implements CommandLineRunner {

    Environment environment;


    public CustomCommandLineRunner(Environment environment) {
        this.environment = environment;
        System.out.println("CustomCommandlIneRunner构造");
    }

    @Override
    public void run(String... args) throws Exception {
        System.out.println("CustomCommandlIneRunner:Run()");
        System.out.println(Objects.requireNonNull(environment.getProperty("random.")));
    }
}
